package com.treasure.mall.zbqmallmanager.controller;

import com.treasure.mall.biz.remote.track.LogisticsProvider;
import com.treasure.mall.biz.remote.track.dto.ReceiveInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/6/15
 */
@RestController
@RequestMapping("/third/callback")
public class ThirdCallbackController {
    @Autowired
    private LogisticsProvider provider;

    @PostMapping("/express")
    public void expressBack(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ReceiveInfo receiveInfo = provider.subCallback(request);

        provider.callbackResp(response);
    }
}
